var express = require('express');
var router = express.Router();
var user = require('../controllers/Controller')
var mine = require('../controllers/mineController')
var moment=require('../controllers/momentController')
var chat=require('../controllers/chatController')
let multer = require('multer');
let upload = multer({ dest: './public/uploads/' }).array('file', 9)
/* GET home page. */

// user
router.get('/getUser', user.getUser);
router.post('/getnotice', user.getNotice);
router.post('/saveAdvice',upload,user.saveAdvice)

//momentController
router.get('/getHot',moment.getHot)
router.get('/getCarousel',moment.getCarousel)
router.get('/getMomentAll',moment.getMomentAll)
router.get('/getSearch',moment.getSearch)
router.get('/getMomentByID',moment.getMomentByID)
router.get('/getMomentsLike',moment.getMomentsLike)
router.get('/getComments',moment.getComments)
router.get('/getMomentType',moment.getMomentType)
router.get('/getMomentsReleased',moment.getMomentsReleased)
router.get('/getMyGoodsOrder',moment.getMyGoodsOrder)
router.post('/deleteMoment',moment.deleteMoment)
router.post('/handleLike',moment.handleLike)
router.post('/saveComment',moment.saveComment)
router.post('/saveFriend',moment.saveFriend)
router.post('/addToCart',moment.addToCart)
router.post('/saveMoment',upload,moment.saveMoment)
router.post('/upload',upload,moment.upload)
//mineController
router.get('/getSchoolList',mine.getSchoolList)
router.get('/getClassList',mine.getClassList)
router.post('/certify',upload,mine.certify)
router.get('/getCart',mine.getCart)
router.post('/deleteGoods',mine.deleteGoods)
router.get('/getMyOrder',mine.getMyOrder)
router.get('/getUserAddress',mine.getUserAddress)
router.get('/getAddressByID',mine.getAddressByID)
router.get('/getUserCare',mine.getUserCare)
router.post('/lockMoment',mine.lockMoment)
router.post('/unlockMoment',mine.unlockMoment)
router.post('/saveOrder',mine.saveOrder)
router.post('/takeOrder',mine.takeOrder)
router.post('/takeSignSeller',mine.takeSignSeller)
router.post('/takeSignBuyer',mine.takeSignBuyer)
router.post('/cancelOrder',mine.cancelOrder)

//chatController
router.post('/saveChat',chat.saveChat)
module.exports = router;
